home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1995 March / Macworld CD-ROM (March 1995).cdr / Updaters / AppMaker 1.5.2->1.5.4 / Libraries / THINK / AMClassLibC / CSlider.cp < prev    next >
Encoding:
Text File  |  1993-04-20  |  1.3 KB  |  46 lines  |  [TEXT/KAHL]

  1. /******************************************************************************
  2.  CSlider.c
  3.  
  4.                             The Slider Class
  5.         
  6.         A standard AppMaker slider control.
  7.     
  8.     SUPERCLASS = CAMButton
  9.     
  10.     Copyright © 1991 Bowers Development Corporation. All rights reserved.
  11.  
  12.  ******************************************************************************/
  13.  
  14. #include "CSlider.h"
  15.  
  16. /******************************************************************************
  17.  DoThumbDragged
  18.  
  19.         User dragged thumb of the slider. Call function to respond
  20.         appropriately.
  21.  ******************************************************************************/
  22.  
  23. void    CSlider::DoThumbDragged (
  24.     short        delta)                    /* Change in control setting        */
  25. {
  26.     if (theThumbFunc!=NULL) {            /* Call thumb function if one        */
  27.         (*theThumbFunc) (this, delta);    /*   exists; otherwise do nothing    */
  28.     }
  29.  
  30. } /* DoThumbDragged */    
  31.  
  32.  
  33. /******************************************************************************
  34.  SetThumbFunc
  35.  
  36.         Set the pointer to the function to be called after the thumb of
  37.         the slider is dragged
  38.  ******************************************************************************/
  39.  
  40. void    CSlider::SetThumbFunc (
  41.     ThumbFuncType    aThumbFunc)            /* Function pointer                    */
  42. {
  43.     theThumbFunc = aThumbFunc;            /* Set instance variable            */
  44.  
  45. } /* SetThumbFunc */
  46.